package com.filyar.htyd.config;

import cn.dev33.satoken.stp.StpLogic;
import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.strategy.SaStrategy;
import com.filyar.htyd.utils.StpMobileUserUtil;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AnnotatedElementUtils;

import javax.annotation.PostConstruct;

@Configuration
public class SaTokenConfigure {
    @PostConstruct
    public void rewriteSaStrategy() {
        // 重写Sa-Token的注解处理器，增加注解合并功能 
        SaStrategy.instance.getAnnotation = AnnotatedElementUtils::getMergedAnnotation;
    }

    @PostConstruct
    public void writeType() {
        StpLogic userLogic = StpUtil.stpLogic;
        StpLogic managerLogic = StpMobileUserUtil.stpLogic;
    }
}